<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    var obj = new Object({a: 1, b: 2});
    var arr = new Array(1, 2, 3, 4);
    var date = new Date();
    var reg = new RegExp();
    var str = new String();
    console.dir(arr);

    console.log(obj.toString());
    console.log(arr.toString());
    console.log(date.toString());
    console.log(reg.toString());

    console.log(Object.prototype.toString.call(obj));
    console.log(Object.prototype.toString.call(arr));
    console.log(Object.prototype.toString.call(date));
    console.log(Object.prototype.toString.call(reg));
    console.log(Object.prototype.toString.call(str));

    console.log(Object.prototype.toString.call(obj)==="[object Object]");
    console.log(Object.prototype.toString.call(arr)==="[object Array]");



</script>

</html>